<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
//use kartik\detail\DetailView;

/* @var $this yii\web\View */
/* @var $model common\models\articlesite\ArticlesiteArticle */

$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => 'Articlesite Articles', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>


<section class="wrapper site-min-height">
    <!-- page start-->
    <section class="panel">
        <header class="panel-heading">
              <?= Html::a('返回','javascript:history.back(-1)'); ?>  <?= Html::encode($this->title) ?>
        </header>
        <div class="panel-body">
            <div class="adv-table editable-table ">

                <div class="articlesite-article-view">

                    <p>
                        <?= Html::a('更新', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
                        <?= Html::a('删除', ['delete', 'id' => $model->id], [
                            'class' => 'btn btn-danger',
                            'data' => [
                                'confirm' => '您确定删除此项吗?',
                                'method' => 'post',
                            ],
                        ]) ?>
                    </p>
                    <?php
                        echo DetailView::widget([
                            'model'=>$model,
                            'template' => '<tr><th style="width:10%">{label}</th><td>{value}</td></tr>',
                            'options' => ['class' => 'table table-striped table-bordered detail-view'],
                            'attributes'=>[
                                'id',
                                'cate.name',
                                'title',
                                'author',
                                'source',
                                [
                                    'attribute'=>'thumb',
                                    'format'=>'raw',
                                    'value' => function($model){
                                        $model->thumb = \common\components\Upload::checkGetUrl($model->thumb);
                                        return Html::img($model->thumb,['width'=>'230px']);
                                    }
                                ],
                                'descripation',
                                [
                                    'attribute'=>'content',
                                    'format'=>'html',
                                ],
                                [
                                    'attribute'=>'createtime',
                                    'format' => ['date', 'php:Y-m-d H:i:s'],
                                ],
                                'displayorder',
                                [
                                    'attribute'=>'status',
                                    'value' => function($model){
                                        return \common\models\articlesite\ArticlesiteArticle::$statuses[$model->status];
                                    },
                                ]
                            ]
                        ]);
                    ?>




                </div>
            </div>
        </div>
    </section>
</section>